require('./Payprogressbar.styl');
const {Timeline,Icon} = SaltUI;

class Payprogressbar extends React.Component {

    constructor(props) {
        super(props);
        this.state = {
            data: []
        };
    }

    render() {
        return (
            <div className="payprogressbar">
                <Timeline>
                    {this.state.data.map((item,index)=>{
                        return <Timeline.Item
                            color={item.color}
                            description={item.description}>
                            <div className="txt">
                                <span>{item.type}</span>
                                <span className="progressBtn" style={{background: item.color}}>{item.progress}</span>
                            </div>
                        </Timeline.Item>
                    })}
                </Timeline>
            </div>
        );
    }

    componentWillMount() {}

    componentDidMount() {}

    componentWillReceiveProps(nextProps) {
        this.setState({data: nextProps.data})
    }

    shouldComponentUpdate(nextProps, nextState) {
        return true;
    }

    componentWillUpdate(nextProps, nextState) {}

    componentDidUpdate(prevProps, prevState) {}

    componentWillUnmount() {}
}

module.exports = Payprogressbar;
